package com.kaoshi.user.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.kaoshi.user.pojo.OperationLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author
 * @since 2024-11-01
 */
public interface OperationLogMapper extends BaseMapper<OperationLog> {


    @Select("<script>" +
            "select *from operation_log o  where 1=1" +
            "<if test='operationLog.username!= null and operationLog.username!= \"\"'>" +
            "and o.username like '%${operationLog.username}%' " +
            "</if>" +
            "<if test='operationLog.start!= null'>" +
            "and o.time &gt;= #{operationLog.start}" +
            "</if>" +
            "<if test='operationLog.end!= null'>" +
            "and o.time &lt;= #{operationLog.end} " +
            "</if></script>")
    Page<OperationLog> findPage(Page<OperationLog> page1, OperationLog operationLog);

}
